<?php

function validateLogin($auid,$accesstoken){
	require 'sql.php';
	$conn2 = mysql_connect($server, $user, $passwd) or die('Could not connect to SQL server ' .mysql_error());
	mysql_select_db($database, $conn2) or die('Could not connect to given database' .mysql_error());
	$valid=false;
	if(isset($auid) && isset($accesstoken)){
		$query = mysql_query("SELECT * FROM users WHERE id = '$auid' AND accesstoken = '$accesstoken'");
		$result = mysql_fetch_row($query);
		if($result == 0){
			$valid= false;
		}else{
			$valid=true;
		}
	}
	//mysql_close($conn2);
	return $valid;
}
?>